package com.example.course.utils.common.enums;


public enum Code {

    /**
     * 操作字段
     */
    SUCCESS(200,"操作成功"),
    SERVER_ERROR(500,"操作失败"),
    /**
     * 登录字段
     */
    NEED_LOGIN(401,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(401,"密码或账号错误"),
    /**
     * token字段
     */
    TOKEN_INVALID(407,"无效的TOKEN"),
    TOKEN_EXPIRE(407,"TOKEN已过期"),
    TOKEN_REQUIRE(407,"TOKEN是必须的"),
    /**
     * 参数字段
     */
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),

    /**
     * 数据字段
     */
    DATA_EXIST(1000,"数据已经存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    /**
     * 权限字段
     */
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限");


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    int code;
    String success;

    Code(int code,String success){
        this.code=code;
        this.success=success;
    }
}
